<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "review_member_order".
 *
 * @property integer $review_member_order_id
 * @property string $out_trade_no
 * @property string $order_name
 * @property integer $member_id
 * @property string $payment_code
 * @property string $order_amount
 * @property integer $order_status
 * @property integer $create_time
 * @property integer $payment_time
 * @property integer $refund_state
 * @property string $refund_amount
 * @property string $out_refund_no
 * @property integer $apply_refund_time
 * @property integer $refund_pass_time
 * @property integer $refund_success_time
 */
class ReviewMemberOrder extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'review_member_order';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['order_name', 'member_id', 'order_amount'], 'required'],
            [['member_id', 'order_status', 'payment_time', 'refund_state', 'apply_refund_time', 'refund_pass_time', 'refund_success_time'], 'integer'],
            [['payment_code'], 'string'],
            [['order_amount', 'refund_amount'], 'number'],
            [['out_trade_no', 'out_refund_no'], 'string', 'max' => 64],
            [['order_name'], 'string', 'max' => 50],

            //默认值
            ['order_status', 'default', 'value' => 10],
            ['create_time', 'default', 'value' => $_SERVER['REQUEST_TIME']],
            ['refund_state', 'default', 'value' => 0],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'review_member_order_id' => '审核会员订单ID',
            'out_trade_no' => '订单编号',
            'order_name' => '订单名称',
            'member_id' => '会员ID',
            'payment_code' => '支付方式名称代码',
            'order_amount' => '订单总价格，结算了商品，优惠、折扣、积分、邮费的最后结果',
            'order_status' => '订单状态：0(已取消)10(默认):未付款;20:已付款;30:已发货;40:已收货;',
            'create_time' => '创建时间',
            'payment_time' => '支付时间',
            'refund_state' => '退款状态，0无退款，1申请退款，2退款失败，3退款成功',
            'refund_amount' => '退款金额',
            'out_refund_no' => '退款编号',
            'apply_refund_time' => '申请退款时间',
            'refund_pass_time' => '退款通过时间',
            'refund_success_time' => '退款成功时间',
        ];
    }
}
